/**
 *将file对象转换成base64
 * @param {File} file  图片的文件对象
 * @returns Promise
 */
export const resolveToBase64 = (file) => {
  return new Promise((resolve) => {
    const fr = new FileReader()

    fr.readAsDataURL(file)

    fr.onload = (e) => {
      resolve(e.target.result)
    }
  })
}
